<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ include file="/includes/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>选修课程</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/common.css" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="<%=request.getContextPath()%>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">

	 var type = '${type}';
		if(type=='choice'){
			alert("选课成功！");
		}
  function loadDepartment(){
		var action = "loadDepartmentJson.action";
		$.getJSON(action,function(data){
			var json = eval(data);
			$.each(json,function(i,n){
				
					$("#departmentId").append('<option value='+json[i].id+'>'+json[i].name+'</option>');
				
			})
		})
		
		 loadCourse();
	}
	function loadCourse(){
		var action = "loadCourseJson.action";
		$.getJSON(action,function(data){
			var json = eval(data);
			$.each(json,function(i,n){
				    
					$("#course").append('<input type="checkbox" name="coursearray" value='+json[i].id+'>'+json[i].name);
				
			})
		})
		
		
	}
	function selClass(){
		
		var id = $("#departmentId").val();			
		var action = "listClazzJson.action?department.id="+id;
		$.getJSON(action,function(data){
			var json = eval(data);
			$("#clazz").text("");
			$.each(json,function(i,n){
					$("#clazz").append('<input type="checkbox" name="clazzarray" value='+json[i].id+'>'+json[i].name);
			});
		})
	}
	
</script>
</head>
	<body">
		
		
		<form action="listCourse.action" method="post" id="form1">
		<!--  
		<input type="hidden"  name="student.id" value="${student.id}"/>
		<input type="hidden"  name="student.version" value="${student.version}"/>
		 -->
		
		 <table class="table_style" border="0" align="center"  cellpadding="3" cellspacing="1" width="800px">
		   	<tr>
		        <td colspan="2">学年<td>
		        <td>
		          <select id="scoreyear" name="scoreyear">
		           <option value="">--请选择学年--</option>
		           <option value="2011年">2011年</option>
		           <option value="2012年" selected>2012年</option>
		           <option value="2013年">2013年</option>
		          </select>
		        </td>
		   		<td colspan="2">学期<td>
		        <td>
		          <select id="scoreterm" name="scoreterm">
		           <option value="第一学期" selected>第一学期</option>
		           <option value="第二学期">第二学期</option>
		          </select>
		        </td>
		        <td colspan="2">课程类型<td>
		        <br><td>
		          <select id="course.status" name="course.status">
		           <option value="2" selected>限选课</option>
		           <option value="3">通选课</option>
		          </select>
		        </td>
		   		<td colspan="2"> <input type="submit" value="查询" /> </td>
		   	  </tr>
		 
		 </table>
		 
	 </form>
	  
	 <form action="studentChoiceCourseSave.action" method="post" id="form1">
	    
		 <table class="table_style" border="0" align="center"  cellpadding="3" cellspacing="1" width="800px">
		     <tr>
		       <td colspan="2">课程编号</td>
		       <td colspan="2">课程名</td>
		       <td colspan="2">学分</td>
	           <td colspan="2">授课教师</td>
	           <td colspan="2">课程类型</td>
		       <td colspan="2">请选择</td>
		     </tr>
		     <tr>
		   
	   				<s:iterator value="courses" id="course" status="st">
	   				    <td colspan="2">${code} </td>
	   				    <td colspan="2">${name} </td>
	   				    <td colspan="2">${credit}</td>
	   				    <td colspan="2">${teacher.name}</td>
	   				    <td colspan="2">
						<s:if test="#attr.course.status == 2">限选课</s:if>
						<s:if test="#attr.course.status == 3">通选课</s:if>
						</td>
	   					<td colspan="2"><input type="checkbox" name="coursearray" value='${id}'></td>
	   					<tr></tr>
	   				</s:iterator>
		   			
		     </tr>
		     <tr></tr>
		     <tr></tr>
		     <tr></tr>
		     <tr></tr>
		     <tr></tr>
		     <tr></tr>
		     <tr></tr>
		     <tr></tr>
		     <tr></tr>
		 </table>    
		 <table class="table_style" border="0" align="center"  cellpadding="3" cellspacing="0">
       	  <tr>
	         <td>
	          <input type="submit" value="提交" />
	          <span class="sub_sp">&nbsp;</span>
	          <s:reset value="重置"/>  
	         </td>
       	  </tr>
	   </table>
	 </form>
		
	</body>
</html>